~roger-booth/mysql-proxy/laminator

« back to all changes in this revision

Viewing changes to lib/mysql-proto.c

  • Committer: jan at mysql
  • Date: 2010-01-08 17:01:06 UTC
  • Revision ID: jan@mysql.com-20100108170106-maf6h3fvl7isaxv8
flip the lua_pushlstring() with the _free() to improve heap utilization

Show diffs side-by-side

added added

removed removed

Lines of Context:
111
111
        packet = g_string_new(NULL);    
112
112
        network_mysqld_proto_append_err_packet(packet, err_packet);
113
113
 
 
114
        network_mysqld_err_packet_free(err_packet);
 
115
 
114
116
        lua_pushlstring(L, S(packet));
115
117
        
116
 
        network_mysqld_err_packet_free(err_packet);
117
 
 
118
118
        g_string_free(packet, TRUE);
119
119
 
120
120
        return 1;
232
232
        packet = g_string_new(NULL);
233
233
        network_mysqld_masterinfo_append(packet, info);
234
234
 
 
235
        network_mysqld_masterinfo_free(info);
 
236
 
235
237
        lua_pushlstring(L, S(packet));
236
238
 
237
 
        network_mysqld_masterinfo_free(info);
238
 
 
239
239
        g_string_free(packet, TRUE);
240
240
 
241
241
        return 1;
258
258
        packet = g_string_new(NULL);    
259
259
        network_mysqld_proto_append_ok_packet(packet, ok_packet);
260
260
 
 
261
        network_mysqld_ok_packet_free(ok_packet);
 
262
        
261
263
        lua_pushlstring(L, S(packet));
262
264
        
263
 
        network_mysqld_ok_packet_free(ok_packet);
264
 
        
265
265
        g_string_free(packet, TRUE);
266
266
 
267
267
        return 1;
314
314
        packet = g_string_new(NULL);    
315
315
        network_mysqld_proto_append_eof_packet(packet, eof_packet);
316
316
 
 
317
        network_mysqld_eof_packet_free(eof_packet);
 
318
        
317
319
        lua_pushlstring(L, S(packet));
318
320
        
319
 
        network_mysqld_eof_packet_free(eof_packet);
320
 
        
321
321
        g_string_free(packet, TRUE);
322
322
 
323
323
        return 1;
386
386
        g_string_free(packet, TRUE);
387
387
                return 0;
388
388
        }
 
389
        
 
390
        network_mysqld_auth_response_free(auth_response);
389
391
 
390
392
        lua_pushlstring(L, S(packet));
391
393
        
392
 
        network_mysqld_auth_response_free(auth_response);
393
394
        g_string_free(packet, TRUE);
394
395
 
395
396
        return 1;
453
454
 
454
455
        packet = g_string_new(NULL);    
455
456
        network_mysqld_proto_append_auth_challenge(packet, auth_challenge);
 
457
        
 
458
        network_mysqld_auth_challenge_free(auth_challenge);
456
459
 
457
460
        lua_pushlstring(L, S(packet));
458
461
        
459
 
        network_mysqld_auth_challenge_free(auth_challenge);
460
462
        g_string_free(packet, TRUE);
461
463
 
462
464
        return 1;