2014-05-07 22:27:00 +00:00
|
|
|
/*
|
2020-02-27 23:26:58 +00:00
|
|
|
Copyright (c) 2010-2020 Roger Light <roger@atchoo.org>
|
2014-05-07 22:27:00 +00:00
|
|
|
|
|
|
|
All rights reserved. This program and the accompanying materials
|
|
|
|
are made available under the terms of the Eclipse Public License v1.0
|
|
|
|
and Eclipse Distribution License v1.0 which accompany this distribution.
|
|
|
|
|
|
|
|
The Eclipse Public License is available at
|
|
|
|
http://www.eclipse.org/legal/epl-v10.html
|
|
|
|
and the Eclipse Distribution License is available at
|
|
|
|
http://www.eclipse.org/org/documents/edl-v10.php.
|
|
|
|
|
|
|
|
Contributors:
|
|
|
|
Roger Light - initial implementation and documentation.
|
|
|
|
*/
|
|
|
|
|
2016-03-13 18:43:13 +00:00
|
|
|
#ifndef MEMORY_MOSQ_H
|
|
|
|
#define MEMORY_MOSQ_H
|
2014-05-07 22:27:00 +00:00
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
2018-08-09 14:21:40 +00:00
|
|
|
#if defined(WITH_MEMORY_TRACKING) && defined(WITH_BROKER) && defined(__GLIBC__)
|
2014-05-07 22:27:00 +00:00
|
|
|
#define REAL_WITH_MEMORY_TRACKING
|
|
|
|
#endif
|
|
|
|
|
2015-04-19 21:10:59 +00:00
|
|
|
void *mosquitto__calloc(size_t nmemb, size_t size);
|
|
|
|
void mosquitto__free(void *mem);
|
|
|
|
void *mosquitto__malloc(size_t size);
|
2014-05-07 22:27:00 +00:00
|
|
|
#ifdef REAL_WITH_MEMORY_TRACKING
|
2015-04-19 21:10:59 +00:00
|
|
|
unsigned long mosquitto__memory_used(void);
|
|
|
|
unsigned long mosquitto__max_memory_used(void);
|
2014-05-07 22:27:00 +00:00
|
|
|
#endif
|
2015-04-19 21:10:59 +00:00
|
|
|
void *mosquitto__realloc(void *ptr, size_t size);
|
|
|
|
char *mosquitto__strdup(const char *s);
|
2014-05-07 22:27:00 +00:00
|
|
|
|
2018-02-24 22:09:19 +00:00
|
|
|
#ifdef WITH_BROKER
|
|
|
|
void memory__set_limit(size_t lim);
|
|
|
|
#endif
|
|
|
|
|
2014-05-07 22:27:00 +00:00
|
|
|
#endif
|