New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@lightningjs/renderer

Package Overview
Dependencies
Maintainers
6
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lightningjs/renderer - npm Package Compare versions

Comparing version 2.11.0 to 2.11.1

15

dist/src/core/TextureMemoryManager.js

@@ -20,2 +20,3 @@ /*

import { isProductionEnvironment } from '../utils.js';
import { getTimeStamp } from './platform.js';
import { bytesToMb } from './utils.js';

@@ -88,2 +89,6 @@ /**

addToOrphanedTextures(texture) {
// if the texture is already in the orphaned textures list add it at the end
if (this.orphanedTextures.includes(texture)) {
this.removeFromOrphanedTextures(texture);
}
// If the texture can be cleaned up, add it to the orphaned textures list

@@ -149,4 +154,12 @@ if (texture.preventCleanup === false) {

const txManager = this.stage.txManager;
while (this.memUsed >= memTarget && this.orphanedTextures.length > 0) {
const timestamp = getTimeStamp();
while (this.memUsed >= memTarget &&
this.orphanedTextures.length > 0 &&
// if it a non-critical cleanup, we will only cleanup for 10ms
(critical || getTimeStamp() - timestamp < 10)) {
const texture = this.orphanedTextures.shift();
if (texture.renderable === true) {
// If the texture is renderable, we can't free it up
continue;
}
texture.free();

@@ -153,0 +166,0 @@ txManager.removeTextureFromCache(texture);

2

package.json
{
"name": "@lightningjs/renderer",
"version": "2.11.0",
"version": "2.11.1",
"description": "Lightning 3 Renderer",

@@ -5,0 +5,0 @@ "type": "module",

@@ -20,2 +20,3 @@ /*

import { isProductionEnvironment } from '../utils.js';
import { getTimeStamp } from './platform.js';
import type { Stage } from './Stage.js';

@@ -172,2 +173,7 @@ import type { Texture } from './textures/Texture.js';

addToOrphanedTextures(texture: Texture) {
// if the texture is already in the orphaned textures list add it at the end
if (this.orphanedTextures.includes(texture)) {
this.removeFromOrphanedTextures(texture);
}
// If the texture can be cleaned up, add it to the orphaned textures list

@@ -245,5 +251,17 @@ if (texture.preventCleanup === false) {

const txManager = this.stage.txManager;
const timestamp = getTimeStamp();
while (this.memUsed >= memTarget && this.orphanedTextures.length > 0) {
while (
this.memUsed >= memTarget &&
this.orphanedTextures.length > 0 &&
// if it a non-critical cleanup, we will only cleanup for 10ms
(critical || getTimeStamp() - timestamp < 10)
) {
const texture = this.orphanedTextures.shift()!;
if (texture.renderable === true) {
// If the texture is renderable, we can't free it up
continue;
}
texture.free();

@@ -250,0 +268,0 @@ txManager.removeTextureFromCache(texture);

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc