shhandler.h #1

  • //
  • guest/
  • perforce_software/
  • p4/
  • 2014-1/
  • sys/
  • shhandler.h
  • View
  • Commits
  • Open Download .zip Download (2 KB)
/*
 * Copyright 1995, 2009 Perforce Software.  All rights reserved.
 *
 * This file is part of Perforce - the FAST SCM System.
 */

/*
 * shhandler.h -- Smart Heap support code.
 *
 * Classes:
 *
 *	SHHandler - Static constructor for the setup of a Smart Heap.
 *	            Only one per application.
 *
 */


class StrPtr;
class StrBuf;

class SHHandler {

    public:

	SHHandler();

	void Tunables();

	void SetTunable( int index, unsigned int *value );

	int SetTunable( const StrPtr &name, StrBuf *value );

	void UnsetTunable( int index );

	int UnsetTunable( const char *name );

	void Close();

	int Checkpoint( const char *tag, int ckpt );

	void ReportLeakage( int ckpt1, int ckpt2 );

	void ListPool( const char *tag,
			int ckpt,
			int show_unused,
			unsigned int detail )
	{
		ListPool( (MEM_POOL)1, tag, ckpt, show_unused, detail );

	}

    private:

	void ListAllPools( const char *tag,
			    int ckpt,
			    int show_unused,
			    unsigned int detail );

	void ListPool( MEM_POOL pool,
			const char *tag,
			int ckpt,
			int show_unused,
			unsigned int detail );

	void ListEntry( const MEM_POOL_ENTRY *entry,
			int ckpt,
			int show_unused );

	MEM_SIZET FlushPool( MEM_POOL pool );

	int Config2Membytes( const char *value );

	static const int i=0;

	// Retain the previous value from the first call of the SH API.
	MEM_SIZET initial_procfree;
	MEM_SIZET initial_poolfree;
	MEM_SIZET initial_ceiling;
	MEM_SIZET initial_procgrowinc;
	MEM_SIZET initial_poolgrowinc;

	int cur_ckpt;
	int max_ckpt;

# ifdef OS_NT
	CRITICAL_SECTION section;
# endif // OS_NT

} ;

# Change User Description Committed
#1 15902 Matt Attaway A second renaming that I will not obliterate as a badge of shame
//guest/perforce_software/p4/2014_1/sys/shhandler.h
#1 15901 Matt Attaway Clean up code to fit modern Workshop naming standards
//guest/perforce_software/p4/2014.1/sys/shhandler.h
#1 12188 Matt Attaway Move 'main' p4 into a release specific directory in prep for new releases
//guest/perforce_software/p4/sys/shhandler.h
#1 9129 Matt Attaway Initial commit of the 2014.1 p4/p4api source code