Skip to content

Commit 6e6d6bb

Browse files
committed
Remove resize_chunk API
The last user has been dropped in the previous commit. This has never worked meaningfully in the first place.
1 parent 1fc4c89 commit 6e6d6bb

File tree

2 files changed

+0
-29
lines changed

2 files changed

+0
-29
lines changed

ext/mysqlnd/mysqlnd_block_alloc.c

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -43,33 +43,6 @@ mysqlnd_mempool_free_chunk(MYSQLND_MEMORY_POOL * pool, void * ptr)
4343
/* }}} */
4444

4545

46-
/* {{{ mysqlnd_mempool_resize_chunk */
47-
static void *
48-
mysqlnd_mempool_resize_chunk(MYSQLND_MEMORY_POOL * pool, void * ptr, size_t old_size, size_t size)
49-
{
50-
DBG_ENTER("mysqlnd_mempool_resize_chunk");
51-
52-
#ifndef ZEND_TRACK_ARENA_ALLOC
53-
/* Try to back-off and guess if this is the last block allocated */
54-
if (ptr == pool->last
55-
&& (ZEND_MM_ALIGNED_SIZE(size) <= ((char*)pool->arena->end - (char*)ptr))) {
56-
/*
57-
This was the last allocation. Lucky us, we can free
58-
a bit of memory from the pool. Next time we will return from the same ptr.
59-
*/
60-
pool->arena->ptr = (char*)ptr + ZEND_MM_ALIGNED_SIZE(size);
61-
DBG_RETURN(ptr);
62-
}
63-
#endif
64-
65-
void *new_ptr = zend_arena_alloc(&pool->arena, size);
66-
memcpy(new_ptr, ptr, MIN(old_size, size));
67-
pool->last = ptr = new_ptr;
68-
DBG_RETURN(ptr);
69-
}
70-
/* }}} */
71-
72-
7346
/* {{{ mysqlnd_mempool_get_chunk */
7447
static void *
7548
mysqlnd_mempool_get_chunk(MYSQLND_MEMORY_POOL * pool, size_t size)
@@ -100,7 +73,6 @@ mysqlnd_mempool_create(size_t arena_size)
10073
ret->checkpoint = NULL;
10174
ret->get_chunk = mysqlnd_mempool_get_chunk;
10275
ret->free_chunk = mysqlnd_mempool_free_chunk;
103-
ret->resize_chunk = mysqlnd_mempool_resize_chunk;
10476
DBG_RETURN(ret);
10577
}
10678
/* }}} */

ext/mysqlnd/mysqlnd_structs.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ struct st_mysqlnd_memory_pool
5555
void *checkpoint;
5656

5757
void* (*get_chunk)(MYSQLND_MEMORY_POOL * pool, size_t size);
58-
void* (*resize_chunk)(MYSQLND_MEMORY_POOL * pool, void * ptr, size_t old_size, size_t size);
5958
void (*free_chunk)(MYSQLND_MEMORY_POOL * pool, void * ptr);
6059
};
6160

0 commit comments

Comments
 (0)