File tree Expand file tree Collapse file tree 3 files changed +6
-0
lines changed
Expand file tree Collapse file tree 3 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,8 @@ void* my_once_alloc(size_t Size, myf MyFlags)
6363 return ((uchar * ) 0 );
6464 }
6565 DBUG_PRINT ("test" ,("my_once_malloc %lu byte malloced" , (ulong ) get_size ));
66+ my_once_allocated += get_size ;
67+ update_malloc_size (get_size , 0 );
6668 next -> next = 0 ;
6769 next -> size = get_size ;
6870 next -> left = get_size - ALIGN_SIZE (sizeof (USED_MEM ));
@@ -113,7 +115,9 @@ void my_once_free(void)
113115 old = next ; next = next -> next ;
114116 free ((uchar * ) old );
115117 }
118+ update_malloc_size (- (longlong ) my_once_allocated , 0 );
116119 my_once_root_block = 0 ;
120+ my_once_allocated = 0 ;
117121
118122 DBUG_VOID_RETURN ;
119123} /* my_once_free */
Original file line number Diff line number Diff line change @@ -94,6 +94,7 @@ const char *soundex_map= "01230120022455012623010202";
9494 /* from my_malloc */
9595USED_MEM * my_once_root_block = 0 ; /* pointer to first block */
9696uint my_once_extra = ONCE_ALLOC_INIT ; /* Memory to alloc / block */
97+ size_t my_once_allocated = 0 ;
9798
9899 /* from my_alarm */
99100int volatile my_have_got_alarm = 0 ; /* declare variable to reset */
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ extern const char *soundex_map;
4040
4141extern USED_MEM * my_once_root_block ;
4242extern uint my_once_extra ;
43+ extern size_t my_once_allocated ;
4344
4445extern struct st_my_file_info my_file_info_default [MY_NFILE ];
4546
You can’t perform that action at this time.
0 commit comments