replace VG_STATIC -> static
[vg.git] / vg_mem.h
index 12a04f986eecce50d2d1fd917b48dd2e725e8703..be11ddd2ef4ce43741b1d23f89eb1718c9a4680f 100644 (file)
--- a/vg_mem.h
+++ b/vg_mem.h
@@ -9,7 +9,7 @@
 #include <stdlib.h>
 #include <malloc.h>
 
-VG_STATIC void vg_print_backtrace(void);
+static void vg_print_backtrace(void);
 
 #define VG_MAX_ALLOCATIONS 128
 #define VG_FUZZ_ALLOCATIONS
@@ -64,46 +64,46 @@ struct vg_linear_allocator
 };
 #pragma pack(pop)
 
-VG_STATIC u32 vg_align8( u32 s );
-VG_STATIC u32 vg_align4( u32 s );
+static u32 vg_align8( u32 s );
+static u32 vg_align4( u32 s );
 
 /* allocate something from a linear allocator */
 __attribute__((warn_unused_result))
-VG_STATIC void *_vg_linear_alloc( void *buffer, u32 size, 
+static void *_vg_linear_alloc( void *buffer, u32 size, 
                                   const char *constr_name );
 
 /* resize latest block of memory from linear */
 __attribute__((warn_unused_result))
-VG_STATIC void *vg_linear_resize( void *buffer, void *data, u32 newsize );
+static void *vg_linear_resize( void *buffer, void *data, u32 newsize );
 
 /* its possible to delete just the last item */
-VG_STATIC void vg_linear_del( void *buffer, void *data );
+static void vg_linear_del( void *buffer, void *data );
 
 /* extend latest block of memory from linear */
 __attribute__((warn_unused_result))
-VG_STATIC void *_vg_linear_extend( void *buffer, void *data, u32 extra,
+static void *_vg_linear_extend( void *buffer, void *data, u32 extra,
                                    const char *constr_name );
 
 /* get the current usage of allocator */
-VG_STATIC u32 vg_linear_get_cur( void *buffer );
+static u32 vg_linear_get_cur( void *buffer );
 
 /* get the capacity of allocator. */
-VG_STATIC u32 vg_linear_get_capacity( void *buffer );
+static u32 vg_linear_get_capacity( void *buffer );
 
 /* get the remaining size of the allocator */
-VG_STATIC u32 vg_linear_remaining( void *buffer );
+static u32 vg_linear_remaining( void *buffer );
 
 /* yeet all memory from linear allocator */
-VG_STATIC void vg_linear_clear( void *buffer );
+static void vg_linear_clear( void *buffer );
 
 /* request all the memory we need in advance */
-VG_STATIC void vg_set_mem_quota( u32 size );
+static void vg_set_mem_quota( u32 size );
 
 /* essentially init() */
-VG_STATIC void vg_alloc_quota(void);
+static void vg_alloc_quota(void);
 
 /* print out tree of current memory used. only works with libc mode */
-VG_STATIC void vg_mem_log( void *lin_alloc, int depth, const char *name );
+static void vg_mem_log( void *lin_alloc, int depth, const char *name );
 
 #define VG_MEM_MCSTR(S) VG_MEM_MCSTR2(S)
 #define VG_MEM_MCSTR2(S) #S
@@ -119,20 +119,20 @@ VG_STATIC void vg_mem_log( void *lin_alloc, int depth, const char *name );
  * ----------------------------------------
  */
 
-VG_STATIC void vg_fatal_error( const char *fmt, ... );
+static void vg_fatal_error( const char *fmt, ... );
 
 #if 0
-VG_STATIC void vg_error(const char *fmt, ...);
-VG_STATIC void vg_info(const char *fmt, ...);
+static void vg_error(const char *fmt, ...);
+static void vg_info(const char *fmt, ...);
 #endif
 
-VG_STATIC u32 vg_align8( u32 s )
+static u32 vg_align8( u32 s )
 {
    u32 m = (s + 7) >> 3;
    return m << 3;
 }
 
-VG_STATIC u32 vg_align4( u32 s )
+static u32 vg_align4( u32 s )
 {
    u32 m = (s + 3) >> 2;
    return m << 2;
@@ -149,7 +149,7 @@ static vg_linear_allocator *vg_linear_header( void *data )
 
 /* allocate something from a linear allocator */
 __attribute__((warn_unused_result))
-VG_STATIC void *_vg_linear_alloc( void *buffer, u32 size, 
+static void *_vg_linear_alloc( void *buffer, u32 size, 
                                   const char *constr_name )
 {
    if( size % 8 ){
@@ -214,7 +214,7 @@ VG_STATIC void *_vg_linear_alloc( void *buffer, u32 size,
 
 /* resize latest block of memory from linear */
 __attribute__((warn_unused_result))
-VG_STATIC void *vg_linear_resize( void *buffer, void *data, u32 newsize )
+static void *vg_linear_resize( void *buffer, void *data, u32 newsize )
 {
    vg_linear_allocator *alloc = vg_linear_header( buffer );
 
@@ -249,7 +249,7 @@ VG_STATIC void *vg_linear_resize( void *buffer, void *data, u32 newsize )
 }
 
 /* its possible to delete just the last item */
-VG_STATIC void vg_linear_del( void *buffer, void *data )
+static void vg_linear_del( void *buffer, void *data )
 {
    vg_linear_allocator *alloc = vg_linear_header( buffer );
 
@@ -274,7 +274,7 @@ VG_STATIC void vg_linear_del( void *buffer, void *data )
 
 /* extend latest block of memory from linear */
 __attribute__((warn_unused_result))
-VG_STATIC void *_vg_linear_extend( void *buffer, void *data, u32 extra,
+static void *_vg_linear_extend( void *buffer, void *data, u32 extra,
                                    const char *constr_name )
 {
    if( !data )
@@ -290,28 +290,28 @@ VG_STATIC void *_vg_linear_extend( void *buffer, void *data, u32 extra,
 }
 
 /* get the current usage of allocator */
-VG_STATIC u32 vg_linear_get_cur( void *buffer )
+static u32 vg_linear_get_cur( void *buffer )
 {
    vg_linear_allocator *alloc = vg_linear_header( buffer );
    return alloc->cur;
 }
 
 /* get the capacity of allocator. */
-VG_STATIC u32 vg_linear_get_capacity( void *buffer )
+static u32 vg_linear_get_capacity( void *buffer )
 {
    vg_linear_allocator *alloc = vg_linear_header( buffer );
    return alloc->size;
 }
 
 /* get the remaining size of the allocator */
-VG_STATIC u32 vg_linear_remaining( void *buffer )
+static u32 vg_linear_remaining( void *buffer )
 {
    vg_linear_allocator *alloc = vg_linear_header( buffer );
    return alloc->size - alloc->cur;
 }
 
 /* yeet all memory from linear allocator */
-VG_STATIC void vg_linear_clear( void *buffer )
+static void vg_linear_clear( void *buffer )
 {
    vg_linear_allocator *alloc = vg_linear_header( buffer );
 
@@ -340,7 +340,7 @@ VG_STATIC void vg_linear_clear( void *buffer )
 }
 
 /* allocate a FIXED SIZE linear allocator */
-VG_STATIC void *_vg_create_linear_allocator( void *lin_alloc, u32 size, 
+static void *_vg_create_linear_allocator( void *lin_alloc, u32 size, 
                                              u16 flags, const char *constr_name)
 {
    assert( sizeof( vg_linear_allocator ) == 32 );
@@ -410,12 +410,12 @@ VG_STATIC void *_vg_create_linear_allocator( void *lin_alloc, u32 size,
 }
 
 /* request all the memory we need in advance */
-VG_STATIC void vg_set_mem_quota( u32 size )
+static void vg_set_mem_quota( u32 size )
 {
    vg_mem.quota = size;
 }
 
-VG_STATIC void vg_alloc_quota(void)
+static void vg_alloc_quota(void)
 {
    u32 size_scratch = 10*1024*1024;
    u32 size = VG_MAX( vg_mem.quota, size_scratch );
@@ -428,7 +428,7 @@ VG_STATIC void vg_alloc_quota(void)
                                                  "Scratch buffer" );
 }
 
-VG_STATIC void vg_mem_log( void *lin_alloc, int depth, const char *name )
+static void vg_mem_log( void *lin_alloc, int depth, const char *name )
 {
    if( vg_mem.use_libc_malloc ){
       vg_linear_allocator *alloc = vg_linear_header( lin_alloc );